package com.reder.practice.dao;

import com.reder.practice.bean.Follower;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 关注和粉丝持久层
 *
 * @author Fish
 * <p>Email: fishinlove@163.com</p>
 * <p>created by 2019/09/20 16:05:06</p>
 */
public interface FollowerDao {
    int deleteByPrimaryKey(Long id);

    int insert(Follower record);

    int insertSelective(Follower record);

    Follower selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Follower record);

    int updateByPrimaryKey(Follower record);

    // 根据关注者和被关注者的 id 来删除
    int deleteByUserIdAndFollowerId(@Param("userId") long userId,
                                    @Param("followerId") long followerId);

    // 查询这个用户关注的用户 id
    List<Long> findByFollowerId(long followerId);
}